package com.laundry.laundry.controller;

import com.laundry.laundry.service.UserService;
import com.laundry.laundrypo.dto.LoginDTO;
import com.laundry.laundrypo.vo.LoginVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/users")
@Api(tags = "用户相关接口")
@RequiredArgsConstructor
public class UserController {

    private final UserService userService;

    @ApiOperation("用户登录接口")
    @PostMapping("/login")
    public LoginVO Login(@RequestBody LoginDTO loginDTO) {
        return userService.login(loginDTO);
    }

}
